package com.ktwlrj.logmanage.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ktwlrj.core.base.SuperEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 日志记录表(Log)实体类
 *
 * @author makejava
 * @since 2019-07-30 22:22:36
 */
@Getter
@Setter
@ToString
@TableName("fyt_log")
public class LogEntity extends SuperEntity {
    private static final long serialVersionUID = -35395030886560667L;

    @TableId
    private String logId;

    @ApiModelProperty(name = "logType", value = "日志类型:0-api调用,2-系统内部方法调用,默认0")
    private Integer logType;

    @ApiModelProperty(name = "requestIp", value = "请求ip")
    private String requestIp;

    @ApiModelProperty(name = "logBody", value = "日志内容")
    private String logBody;

    @ApiModelProperty(name = "methodData", value = "方法参数")
    private String methodData;

    @ApiModelProperty(name = "requestState", value = "请求结果,response响应状态码,默认200")
    private Integer requestState;

    @ApiModelProperty(name = "realName", value = "当前登录用户姓名")
    private String realName;

    @ApiModelProperty(name = "exceptionState", value = "异常状态:0-未发生异常,1-发生异常,默认0")
    private Integer exceptionState;

    @ApiModelProperty(name = "exceptionData", value = "异常内容")
    private String exceptionData;

    @ApiModelProperty(name = "alreadyUsed", value = "是否已经被使用,用于计算账号冻结情况:0-未使用,1-使用,默认1")
    private Integer alreadyUsed;

    @ApiModelProperty(name = "expand1", value = "扩展1")
    private String expand1;

    @ApiModelProperty(name = "expand2", value = "扩展2")
    private String expand2;

    @Override
    protected Serializable pkVal() {
        return this.logId;
    }
}